﻿<UserControl x:Class="nRoute.Samples.FutureDesktop.Controls.WorkspaceControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	mc:Ignorable="d"
    xmlns:n="http://nRoute/schemas/2010/xaml"
    d:DesignWidth="600" d:DesignHeight="500">
	
	<UserControl.Resources>
		<n:ValueConverterRelay x:Name="TitleConverter" />
	</UserControl.Resources>
    
    <Grid x:Name="LayoutRoot" >
		
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="WorkspaceStateGroup">
    			<VisualState x:Name="ActiveState">
    				<Storyboard>
    					<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BladeSelectBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
    						<DiscreteObjectKeyFrame KeyTime="00:00:00">
    							<DiscreteObjectKeyFrame.Value>
    								<Visibility>Visible</Visibility>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="WorkspaceContainer" Storyboard.TargetProperty="(UIElement.Visibility)">
    						<DiscreteObjectKeyFrame KeyTime="00:00:00">
    							<DiscreteObjectKeyFrame.Value>
    								<Visibility>Visible</Visibility>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="StateText" Storyboard.TargetProperty="(TextBlock.Text)">
    						<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="-"/>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="CollapsedState">
    				<Storyboard>
    					<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BladeSelectBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
    						<DiscreteObjectKeyFrame KeyTime="00:00:00">
    							<DiscreteObjectKeyFrame.Value>
    								<Visibility>Collapsed</Visibility>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="WorkspaceContainer" Storyboard.TargetProperty="(UIElement.Visibility)">
    						<DiscreteObjectKeyFrame KeyTime="00:00:00">
    							<DiscreteObjectKeyFrame.Value>
    								<Visibility>Collapsed</Visibility>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="StateText" Storyboard.TargetProperty="(TextBlock.Text)">
    						<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="+"/>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
        
        <!--- BLADE -->
        <Border Width="44" HorizontalAlignment="Left" VerticalAlignment="Top" Background="Transparent" 
             MouseLeftButtonUp="Blade_MouseLeftButtonUp" Cursor="hand" MinHeight="300">
            <Canvas Height="45" Margin="0,1,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
                
                <Canvas.OpacityMask>
                    <LinearGradientBrush EndPoint="9.62,0.522" StartPoint="-0.022,0.533">
                        <GradientStop Color="#FF000000" Offset="0.879"/>
                        <GradientStop Color="#00FFFFFF" Offset="0.982"/>
                    </LinearGradientBrush>
                </Canvas.OpacityMask>
                <Canvas.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="90"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Canvas.RenderTransform>
                <Border RenderTransformOrigin="0.5,0.5" Width="500" BorderThickness="0,2,0,2" Height="45">
                    <Border.BorderBrush>
                        <LinearGradientBrush EndPoint="0.99,-0.133" StartPoint="0.116,-0.133">
                            <GradientStop Color="#00FFFFFF" Offset="0.688"/>
                            <GradientStop Color="#FFD6CFC8" Offset="0.384"/>
                        </LinearGradientBrush>
                    </Border.BorderBrush>
                </Border>
                <Border Height="27.135" Width="3.585" Canvas.Top="8.09" x:Name="BladeSelectBorder" 
                        RenderTransformOrigin="0.5,0.5" Canvas.Left="-0.174" Background="{StaticResource BkgContrastColorBrush}" Visibility="Collapsed">
                	<Border.RenderTransform>
                		<TransformGroup>
                			<ScaleTransform ScaleX="-1"/>
                			<SkewTransform/>
                			<RotateTransform/>
                			<TranslateTransform/>
                		</TransformGroup>
                	</Border.RenderTransform>
                </Border>

                <!--- TEXT -->
                <TextBlock x:Name="StateText" Height="Auto" Width="Auto" RenderTransformOrigin="0.5,0.5" FontFamily="Arial" 
                           FontSize="20" Text="+" TextWrapping="NoWrap" d:LayoutOverrides="Height" HorizontalAlignment="Center" 
                           VerticalAlignment="Center" Canvas.Top="12.752" Canvas.Left="15" FontWeight="Bold" 
                           Foreground="#FF969696" TextOptions.TextHintingMode="Animated"/>
                <TextBlock Height="Auto" RenderTransformOrigin="0.5,0.5" FontFamily="Arial" FontSize="20" 
                           TextWrapping="NoWrap" Canvas.Left="36" Canvas.Top="12.752"
                           Text="{Binding Title, Converter={StaticResource TitleConverter}, ElementName=WorkspaceContainer, Mode=OneWay}" 
                           TextTrimming="WordEllipsis" TextOptions.TextHintingMode="Animated" />
                
            </Canvas>
        </Border>
        
        <!--- NAVIGATION CONTAINER -->
    	<n:StatefulBrowsingContainer Margin="44,1,0,0" VerticalAlignment="Stretch"
            x:Name="WorkspaceContainer" Url="Home" Visibility="Collapsed" />
    </Grid>
    
</UserControl>
